from page.base_page import BasePage
from appium.webdriver.common.mobileby import By

class SpplPage(BasePage):
    #定位器
    djpl_locator = (By.ID, 'com.gfeng.daydaycook:id/tv_comment')
    input_locator = (By.ID, 'com.gfeng.daydaycook:id/et_comment')
    fh_locator = (By.ID, 'com.gfeng.daydaycook:id/tv_comment_count')
    text_locator = (By.ID, '//android.widget.TextView[@resource-id=\"com.gfeng.daydaycook:id/tv_seen_title\"]')

    #操作方法
    #点击评论
    def click_djpl(self):
        self.driver.find_element(*self.djpl_locator).click()
    #输入内容
    def click_input(self,driver):
        self.driver.find_element(*self.input_locator).send_keys(driver)
    #点击返回
    def click_fh(self):
        self.driver.find_element(*self.fh_locator).click()

    # 获取文本
    def hq_text(self):
        self.driver.find_element(*self.text_locator).get_attribute('text')